<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Route::any('/isVisit', 'VisitController@isVisit');

Route::namespace('v1')->prefix('api/v1')->middleware(['validate'])->group(function (){
    Route::post('image','OtherController@image');
    Route::apiResource('capintro','CapintroController');
    Route::get('capintro/member/{id}','CapintroController@member');
    Route::get('capintro/item/{id}','CapintroController@item');
    Route::get('moreCapintro/{id}','CapintroController@more');
    Route::get('home','HomeController@index');
});
/**
 * admin路由表
 */

Route::namespace('Admin')->prefix('admin')->middleware(['admin.auth','validate'])->group(function (){
    Route::get('info','AdminController@info');
    Route::post('logout','AuthController@logout');
    Route::get('skill/all','SkillController@all');
    Route::apiResource('skill','SkillController');
    Route::get('team/all','TeamController@all');
    Route::get('project/all','ProjectController@all');
    Route::apiResource('team','TeamController');
    Route::apiResource('craftsman','CraftsmanController');
    Route::post('member','MemberController@store');
    Route::get('member/{id}','MemberController@index');
    Route::get('item/{crafts}','ItemController@index');
    Route::get('items/{id}','ItemController@show');//用户审核接口
    Route::get('xmgz/{id}','ItemController@shenhe');//项目注册审核代码
    Route::get('zgxx/{id}','ItemController@dit');//发布招工信息审核代码
    //公告管理
    Route::post('notice','AdminController@notices');//发布公告
    Route::get('noticeedit/{id}','AdminController@update');//修改公告
    Route::get('noticedestroy/{id}','AdminController@destroy');//删除公告
    Route::get('noticeshow','AdminController@show'); //显示所有公告
    Route::post('item','ItemController@store');
    Route::delete('item/{item}','ItemController@destroy');
    Route::get('news','AdminController@news');
});
Route::get('/newsinfo','Admin\AdminController@newsinfo');

Route::namespace('Admin')->prefix('admin')->middleware(['validate'])->group(function (){
    Route::post('login','AuthController@login');
});
Route::get('test','Admin\AuthController@test');